<!--
    页面名称：管理员 - 查看指定员工信息
    作者: 苗怀雨
    时间:2017-12-31 22:46:30
-->

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<tag:head title="员工信息" ctx="${ctx}">
	<!-- Switchery -->
	<link href="${ctx}/assets/css/switchery/switchery.min.css" rel="stylesheet">
	<!-- this page -->
	<link href="${ctx}/assets/css/admin/admin_department_add/style.css" rel="stylesheet">
</tag:head>

<tag:body>
	<!-- 左 上 导航 -->
	<tag:nav ctx="${ctx}"></tag:nav>

	<!-- page content -->
	<tag:content title="员工信息">
		<div class="col-sm-12">
			<form action="${ctx}/admin/updateStaff" method="post">
				<div class="form-group col-sm-12" style="display: none">
					<label class="control-label col-sm-2">员工ID:</label>
					<div class="col-sm-2">
						<input type="text" name="staffId" value="${requestScope.staff.staffId}" class="form-control col-md-3 col-xs-12"/>										</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">用户名:</label>
					<div class="col-sm-4">
						<input type="text" name="username" value="${requestScope.staff.username}" disabled class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">姓名:</label>
					<div class="col-sm-4">
						<input type="text" placeholder="长度在1到12之间" name="staffName" value="${requestScope.staff.name}" class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">角色:</label>
					<div class="col-sm-4">
						<select class="form-control" id="role" name="roleId">
							<option value="">无</option>
							<c:forEach var="role" items="${requestScope.roles}">
								<option value="${role.roleId}">${role.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">读者等级:</label>
					<div class="col-sm-5">
						<c:forEach begin="1" end="${requestScope.staff.grade}">
							<img src="${ctx}/assets/images/star4.gif" />
						</c:forEach>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">邮箱:</label>
					<div class="col-sm-5">
						<input type="text" name="email" placeholder="长度不要超过20" value="${requestScope.staff.email}" class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">qq:</label>
					<div class="col-sm-5">
						<input type="text" name="qq" placeholder="长度不要超过20且必须都为数字" value="${requestScope.staff.qq}" class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">部门名称:</label>
					<div class="col-sm-5">
						<input type="text" name="department" placeholder="长度在1到12之间" value="${requestScope.staff.department}" class="form-control col-md-3 col-xs-12"/>
						<div class="error"></div>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">已借阅:</label>
					<div class="col-sm-3">
						<input type="text" name="Number" value="${requestScope.staff.borrowedNumber}" disabled class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">黑名单状态:</label>
					<div class="col-sm-3">
						<div class="">
							<label>
								<c:if test="${requestScope.staff.state == false}">
									<input type="checkbox" class="js-switch" name="state2"  />
									<input type="hidden" name="state" value="0" />
								</c:if>
								<c:if test="${requestScope.staff.state == true}">
									<input type="checkbox" class="js-switch" name="state2" checked />
									<input type="hidden" name="state" value="0"/>
								</c:if>
							</label>
						</div>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">最多可借:</label>
					<div class="col-sm-3">
						<input type="text" name="maxNumber" placeholder="数值在0到20之间" value="${requestScope.staff.maxBorrowNumber}" class="form-control col-md-3 col-xs-12"/>
					</div>
				</div>
				<div class="form-group col-sm-12">
					<label class="control-label col-sm-2">上次登录时间:</label>
					<div class="col-sm-5">
						<p id="loginTime">${requestScope.staff.lastLoginTime}</p>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-sm-2"></label>
				</div>
				<div class="form-group">
					<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-4">
						<button id="save" type="button" class="btn btn-success">保存</button>
						<button type="button" class="btn btn-info">返回</button>
					</div>
				</div>
				<div class="emptyRow"></div>
			</form>
		</div>
	</tag:content>
	<!-- /page content -->

	<!-- footer content -->
	<tag:footer></tag:footer>

</tag:body>

<!-- javascript-->
<tag:javascript ctx="${ctx}">
	<script src="${ctx}/assets/js/admin/admin_staff_info/admin_staff_info.js"></script>	<!-- this page -->
	<!-- Switchery -->
	<script src="${ctx}/assets/js/switchery/switchery.min.js"></script>
	<script>
		$("select").val(${requestScope.staff.role.roleId});
	</script>
</tag:javascript>
</html>
